<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>事件修饰符</title>
  <style>
    div div {
      width: 100px;
      height: 100px;
      border: 1px solid red;
      text-align: center;
      line-height: 100px;
    }
  </style>
</head>
<body>

<div id="app">

  <div @click="parentClick">
    <button @click="childClick" title="未阻止冒泡">子按钮</button>
  </div>

  <hr>

  <div @click="parentClick">
    <button @click.stop="childClick" title="阻止冒泡">子按钮</button>
  </div>

</div>

<script src="../lib/vue.js"></script>
<script>
  let vm = new Vue({
    el: '#app',
    methods: {
      childClick() {
        console.log('我是子元素')
      },
      parentClick() {
        console.log('我是父元素')
      },
    }
  })
</script>

</body>
</html>